package org.meetunexpectedly.entity.user;

import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.meetunexpectedly.entity.BaseEntity;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import java.util.Set;

/**
 * @Description: 用户表
 * @Author: pupil
 * @Date: 2024/08/03 下午 6:54
 */
@Data
@EqualsAndHashCode(callSuper = false) //不重写父类的hashcode和toString
public class User extends BaseEntity {
    private static final long serialVersionUID = 1L;

    @Email
    private String email; // 邮箱

    @NotBlank(message = "密码不能为空")
    private String password; // 密码

    private String nickName; // 昵称

    private String description; // 简介

    private Boolean sex; // true 为男，false为女

    private Long avatar; // 头像

    private Long defaultFavoritesId; // 用户默认收藏夹id

    @TableField(exist = false)
    private Boolean each; // 用于判断是否相互关注

    @TableField(exist = false)
    private Set<String> roleName; // 角色名称

}